package personal.zq.practice.common.utils;

import personal.zq.practice.common.bo.IReturnCode;
import personal.zq.practice.common.enums.ReturnCodeEnum;
import personal.zq.practice.common.exception.BaseException;

/**
 * @author zhangqing
 * @version 1.0
 * @date 2022/9/21
 */
public class BusinessException extends BaseException {
    private static final long serialVersionUID = -9103217173522466144L;

    public BusinessException() {
    }

    public BusinessException(IReturnCode iReturnCode) {
        super(iReturnCode.getCode(), iReturnCode.getMsg());
    }

    public BusinessException(String message) {
        super(ReturnCodeEnum.BUSINESS_ERROR.getCode(), message);
    }

    public BusinessException(IReturnCode iReturnCode, String message) {
        super(iReturnCode.getCode(), message);
    }

    public BusinessException(int code, String message) {
        super(code, message);
    }

    public BusinessException(int code, String message, Throwable cause) {
        super(code, message, cause);
    }

    public BusinessException(int code, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(code, message, cause, enableSuppression, writableStackTrace);
    }
}
